package com.moqianfan.mcuassistant.database;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.moqianfan.mcuassistant.bean.Article;
import com.moqianfan.mcuassistant.bean.ASMCourse;
import com.moqianfan.mcuassistant.bean.CCourse;
import com.moqianfan.mcuassistant.bean.Collec;
import com.moqianfan.mcuassistant.bean.CSource;
import com.moqianfan.mcuassistant.bean.McuCourse;
import com.moqianfan.mcuassistant.bean.McuOrder;
import com.moqianfan.mcuassistant.bean.McuSource;

import com.moqianfan.mcuassistant.database.ArticleDao;
import com.moqianfan.mcuassistant.database.ASMCourseDao;
import com.moqianfan.mcuassistant.database.CCourseDao;
import com.moqianfan.mcuassistant.database.CollecDao;
import com.moqianfan.mcuassistant.database.CSourceDao;
import com.moqianfan.mcuassistant.database.McuCourseDao;
import com.moqianfan.mcuassistant.database.McuOrderDao;
import com.moqianfan.mcuassistant.database.McuSourceDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig articleDaoConfig;
    private final DaoConfig aSMCourseDaoConfig;
    private final DaoConfig cCourseDaoConfig;
    private final DaoConfig collecDaoConfig;
    private final DaoConfig cSourceDaoConfig;
    private final DaoConfig mcuCourseDaoConfig;
    private final DaoConfig mcuOrderDaoConfig;
    private final DaoConfig mcuSourceDaoConfig;

    private final ArticleDao articleDao;
    private final ASMCourseDao aSMCourseDao;
    private final CCourseDao cCourseDao;
    private final CollecDao collecDao;
    private final CSourceDao cSourceDao;
    private final McuCourseDao mcuCourseDao;
    private final McuOrderDao mcuOrderDao;
    private final McuSourceDao mcuSourceDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        articleDaoConfig = daoConfigMap.get(ArticleDao.class).clone();
        articleDaoConfig.initIdentityScope(type);

        aSMCourseDaoConfig = daoConfigMap.get(ASMCourseDao.class).clone();
        aSMCourseDaoConfig.initIdentityScope(type);

        cCourseDaoConfig = daoConfigMap.get(CCourseDao.class).clone();
        cCourseDaoConfig.initIdentityScope(type);

        collecDaoConfig = daoConfigMap.get(CollecDao.class).clone();
        collecDaoConfig.initIdentityScope(type);

        cSourceDaoConfig = daoConfigMap.get(CSourceDao.class).clone();
        cSourceDaoConfig.initIdentityScope(type);

        mcuCourseDaoConfig = daoConfigMap.get(McuCourseDao.class).clone();
        mcuCourseDaoConfig.initIdentityScope(type);

        mcuOrderDaoConfig = daoConfigMap.get(McuOrderDao.class).clone();
        mcuOrderDaoConfig.initIdentityScope(type);

        mcuSourceDaoConfig = daoConfigMap.get(McuSourceDao.class).clone();
        mcuSourceDaoConfig.initIdentityScope(type);

        articleDao = new ArticleDao(articleDaoConfig, this);
        aSMCourseDao = new ASMCourseDao(aSMCourseDaoConfig, this);
        cCourseDao = new CCourseDao(cCourseDaoConfig, this);
        collecDao = new CollecDao(collecDaoConfig, this);
        cSourceDao = new CSourceDao(cSourceDaoConfig, this);
        mcuCourseDao = new McuCourseDao(mcuCourseDaoConfig, this);
        mcuOrderDao = new McuOrderDao(mcuOrderDaoConfig, this);
        mcuSourceDao = new McuSourceDao(mcuSourceDaoConfig, this);

        registerDao(Article.class, articleDao);
        registerDao(ASMCourse.class, aSMCourseDao);
        registerDao(CCourse.class, cCourseDao);
        registerDao(Collec.class, collecDao);
        registerDao(CSource.class, cSourceDao);
        registerDao(McuCourse.class, mcuCourseDao);
        registerDao(McuOrder.class, mcuOrderDao);
        registerDao(McuSource.class, mcuSourceDao);
    }
    
    public void clear() {
        articleDaoConfig.clearIdentityScope();
        aSMCourseDaoConfig.clearIdentityScope();
        cCourseDaoConfig.clearIdentityScope();
        collecDaoConfig.clearIdentityScope();
        cSourceDaoConfig.clearIdentityScope();
        mcuCourseDaoConfig.clearIdentityScope();
        mcuOrderDaoConfig.clearIdentityScope();
        mcuSourceDaoConfig.clearIdentityScope();
    }

    public ArticleDao getArticleDao() {
        return articleDao;
    }

    public ASMCourseDao getASMCourseDao() {
        return aSMCourseDao;
    }

    public CCourseDao getCCourseDao() {
        return cCourseDao;
    }

    public CollecDao getCollecDao() {
        return collecDao;
    }

    public CSourceDao getCSourceDao() {
        return cSourceDao;
    }

    public McuCourseDao getMcuCourseDao() {
        return mcuCourseDao;
    }

    public McuOrderDao getMcuOrderDao() {
        return mcuOrderDao;
    }

    public McuSourceDao getMcuSourceDao() {
        return mcuSourceDao;
    }

}
